package com.caimiao.miao.http.retorfit;

import com.caimiao.miao.bean.Response;
import com.caimiao.miao.bean.TicketOut;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface RequestApi {

    @POST("/dev/initDevInfo")
    @FormUrlEncoded
    Observable<Response> postInitDevice(@Field("dev_code") String devId);

    @POST("/dev/setDevInfo")
    @FormUrlEncoded
    Observable<Response> postUpdateDevice(@FieldMap Map<String, Object> params);

    @POST("/dev/setDevTicketNum")
    @FormUrlEncoded
    Observable<Response> postAddTicket(@FieldMap Map<String, Object> params);

    @POST("/dev/setTicketRecord")
    @FormUrlEncoded
    Observable<Response> postOutTicket(@FieldMap Map<String, Object> params);

    @GET("/dev/askForResult")
    Observable<Response<TicketOut>> getTicketOut(@Query("dev_code") String devId);
}
